package com.imooc.miaosha.result;

import lombok.Getter;

/**
 * 枚举: <br>
 * ()
 *
 * @Author: Mr. xyb
 * @Date: 2019/4/14 14:40
 * @since: 1.8.0
 * @version: 1.0.0
 */
@Getter
public enum ResultEnums {

    // 系统级
    SUCCESS(0, "响应成功"),
    SERVER_ERROR(-1, "响应失败"),
    PARAM_OBJ_EMPTY(-2, "参数对象为空"),
    REQUEST_ILLEGAL(-3, "非法请求"),
    ACCESS_LIMIT_REACHED(-4, "请求太频繁，请稍后再访问"),

    // 登录模块
    SESSION_ERROR(500210, "Session不存在或者已经失效"),
    PASSWORD_EMPTY(500211, "登录密码不能为空"),
    MOBILE_EMPTY(500212, "手机号不能为空"),
    MOBILE_FORMAT_ERROR(500213, "手机号格式不正确"),
    MOBILE_NOT_EXIST(500214, "手机号不存在"),
    LOGIN_SUCCESS(500215, "登录成功"),
    LOGIN_ERROR(500216, "登录失败"),
    BIND_ERROR(500217, "参数校验异常：%s"),

    // 秒杀模块
    MIAO_SHA_ENDING(500500, "商品秒杀结束"),
    REPREATE_MIAOSHA(500501, "不能重复秒杀"),
    MIAOSHA_FAIL(500502, "秒杀失败"),
    VERIFY_CODE_FAIL(500502, "验证码错误"),


    // 订单模块
    ORDER_NOT_EXIST(500600, "订单不存在"),
    ;

    private Integer code;

    private String msg;

    ResultEnums(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
